OrmLiteDialectProviderBase<TDialect>
Assembly: ServiceStack.OrmLite.dll
View Source
public abstract class OrmLiteDialectProviderBase<TDialect> : object, IOrmLiteDialectProvider where TDialect : IOrmLiteDialectProvider
Properties
Variables
View Source
public Dictionary<string, string> Variables { get; set; }
ExecFilter
View Source
public IOrmLiteExecFilter ExecFilter { get; set; }
DecimalConverter
View Source
public DecimalConverter DecimalConverter { get; }
StringConverter
View Source
public StringConverter StringConverter { get; }
OnOpenConnection
View Source
public Action<IDbConnection> OnOpenConnection { get; set; }
ParamString
View Source
public string ParamString { get; set; }
NamingStrategy
View Source
public INamingStrategy NamingStrategy { get; set; }
StringSerializer
View Source
public IStringSerializer StringSerializer { get; set; }
ParamNameFilter
View Source
public Func<string, string> ParamNameFilter { get; set; }
EnumConverter
View Source
public EnumConverter EnumConverter { get; set; }
RowVersionConverter
View Source
public RowVersionConverter RowVersionConverter { get; set; }
ReferenceTypeConverter
View Source
public ReferenceTypeConverter ReferenceTypeConverter { get; set; }
ValueTypeConverter
View Source
public ValueTypeConverter ValueTypeConverter { get; set; }
SelectIdentitySql
View Source
public virtual string SelectIdentitySql { get; set; }
CreateTableFieldsStrategy
View Source
public Func<ModelDefinition, IEnumerable<FieldDefinition>> CreateTableFieldsStrategy { get; set; }
SqlRandom
View Source
public virtual string SqlRandom { get; }
Fields
Log
View Source
protected static readonly ILog Log
Converters
View Source
public Dictionary<Type, IOrmLiteConverter> Converters
AutoIncrementDefinition
View Source
public string AutoIncrementDefinition
DefaultValueFormat
View Source
public string DefaultValueFormat
Methods
InitColumnTypeMap()
View Source
protected void InitColumnTypeMap()
GetColumnTypeDefinition(Type, Nullable<Int32>, Nullable<Int32>)
View Source
public string GetColumnTypeDefinition(Type columnType, int? fieldLength, int? scale)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | columnType |
System.Nullable<System.Int32> | fieldLength |
System.Nullable<System.Int32> | scale |
InitDbParam(IDbDataParameter, Type)
View Source
public virtual void InitDbParam(IDbDataParameter dbParam, Type columnType)
Parameters
Type | Name |
---|---|
IDbDataParameter | dbParam |
Type | columnType |
CreateParam()
View Source
public abstract IDbDataParameter CreateParam()
Returns
IDbDataParameter
RemoveConverter<T>()
View Source
public void RemoveConverter<T>()
Type Parameters
T
RegisterConverter<T>(IOrmLiteConverter)
View Source
public void RegisterConverter<T>(IOrmLiteConverter converter)
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.IOrmLiteConverter | converter |
Type Parameters
T
GetConverter(Type)
View Source
public IOrmLiteConverter GetConverter(Type type)
Returns
ServiceStack.OrmLite.IOrmLiteConverter
Parameters
Type | Name |
---|---|
Type | type |
ShouldQuoteValue(Type)
View Source
public virtual bool ShouldQuoteValue(Type fieldType)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
Type | fieldType |
FromDbRowVersion(Type, Object)
View Source
public virtual object FromDbRowVersion(Type fieldType, object value)
Returns
System.Object
Parameters
Type | Name |
---|---|
Type | fieldType |
System.Object | value |
GetConverterBestMatch(Type)
View Source
public IOrmLiteConverter GetConverterBestMatch(Type type)
Returns
ServiceStack.OrmLite.IOrmLiteConverter
Parameters
Type | Name |
---|---|
Type | type |
GetConverterBestMatch(FieldDefinition)
View Source
public virtual IOrmLiteConverter GetConverterBestMatch(FieldDefinition fieldDef)
Returns
ServiceStack.OrmLite.IOrmLiteConverter
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ToDbValue(Object, Type)
View Source
public virtual object ToDbValue(object value, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | value |
Type | type |
FromDbValue(Object, Type)
View Source
public virtual object FromDbValue(object value, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | value |
Type | type |
GetValue(IDataReader, Int32, Type)
View Source
public object GetValue(IDataReader reader, int columnIndex, Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
IDataReader | reader |
System.Int32 | columnIndex |
Type | type |
GetValues(IDataReader, Object[])
View Source
public virtual int GetValues(IDataReader reader, object[] values)
Returns
System.Int32
Parameters
Type | Name |
---|---|
IDataReader | reader |
System.Object[] | values |
CreateConnection(String, Dictionary<String, String>)
View Source
public abstract IDbConnection CreateConnection(string filePath, Dictionary<string, string> options)
Returns
IDbConnection
Parameters
Type | Name |
---|---|
System.String | filePath |
Dictionary<System.String,System.String> | options |
GetQuotedValue(String)
View Source
public virtual string GetQuotedValue(string paramValue)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | paramValue |
GetSchemaName(String)
View Source
public virtual string GetSchemaName(string schema)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
GetTableName(ModelDefinition)
View Source
public virtual string GetTableName(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetTableName(ModelDefinition, Boolean)
View Source
public virtual string GetTableName(ModelDefinition modelDef, bool useStrategy)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
System.Boolean | useStrategy |
GetTableName(String, String)
View Source
public virtual string GetTableName(string table, string schema = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | table |
System.String | schema |
GetTableName(String, String, Boolean)
View Source
public virtual string GetTableName(string table, string schema, bool useStrategy)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | table |
System.String | schema |
System.Boolean | useStrategy |
GetQuotedTableName(ModelDefinition)
View Source
public virtual string GetQuotedTableName(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetQuotedTableName(String, String)
View Source
public virtual string GetQuotedTableName(string tableName, string schema = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | tableName |
System.String | schema |
GetQuotedTableName(String, String, Boolean)
View Source
public virtual string GetQuotedTableName(string tableName, string schema, bool useStrategy)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | tableName |
System.String | schema |
System.Boolean | useStrategy |
GetQuotedColumnName(String)
View Source
public virtual string GetQuotedColumnName(string columnName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | columnName |
ShouldQuote(String)
View Source
public virtual bool ShouldQuote(string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | name |
QuoteIfRequired(String)
View Source
public virtual string QuoteIfRequired(string name)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
GetQuotedName(String)
View Source
public virtual string GetQuotedName(string name)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
GetQuotedName(String, String)
View Source
public virtual string GetQuotedName(string name, string schema)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
System.String | schema |
SanitizeFieldNameForParamName(String)
View Source
public virtual string SanitizeFieldNameForParamName(string fieldName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | fieldName |
GetColumnDefinition(FieldDefinition)
View Source
public virtual string GetColumnDefinition(FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
GetLastInsertId(IDbCommand)
View Source
public virtual long GetLastInsertId(IDbCommand dbCmd)
Returns
System.Int64
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
GetLastInsertIdSqlSuffix<T>()
View Source
public virtual string GetLastInsertIdSqlSuffix<T>()
Returns
System.String
Type Parameters
T
IsFullSelectStatement(String)
View Source
public virtual bool IsFullSelectStatement(string sql)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | sql |
ToSelectStatement(Type, String, Object[])
View Source
public virtual string ToSelectStatement(Type tableType, string sqlFilter, params object[] filterParams)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | tableType |
System.String | sqlFilter |
System.Object[] | filterParams |
ApplyTags(StringBuilder, ISet<String>)
View Source
protected virtual void ApplyTags(StringBuilder sqlBuilder, ISet<string> tags)
Parameters
Type | Name |
---|---|
StringBuilder | sqlBuilder |
ISet<System.String> | tags |
ToSelectStatement(QueryType, ModelDefinition, String, String, String, Nullable<Int32>, Nullable<Int32>, ISet<String>)
View Source
public virtual string ToSelectStatement(QueryType queryType, ModelDefinition modelDef, string selectExpression, string bodyExpression, string orderByExpression = null, int? offset = null, int? rows = null, ISet<string> tags = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.QueryType | queryType |
ServiceStack.OrmLite.ModelDefinition | modelDef |
System.String | selectExpression |
System.String | bodyExpression |
System.String | orderByExpression |
System.Nullable<System.Int32> | offset |
System.Nullable<System.Int32> | rows |
ISet<System.String> | tags |
GenerateComment(in String)
View Source
public virtual string GenerateComment(in string text)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
InitConnection(IDbConnection)
View Source
public virtual void InitConnection(IDbConnection dbConn)
Parameters
Type | Name |
---|---|
IDbConnection | dbConn |
GetRowVersionSelectColumn(FieldDefinition, String)
View Source
public virtual SelectItem GetRowVersionSelectColumn(FieldDefinition field, string tablePrefix = null)
Returns
ServiceStack.OrmLite.SelectItem
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | field |
System.String | tablePrefix |
GetRowVersionColumn(FieldDefinition, String)
View Source
public virtual string GetRowVersionColumn(FieldDefinition field, string tablePrefix = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | field |
System.String | tablePrefix |
GetColumnNames(ModelDefinition)
View Source
public virtual string GetColumnNames(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetColumnNames(ModelDefinition, String)
View Source
public virtual SelectItem[] GetColumnNames(ModelDefinition modelDef, string tablePrefix)
Returns
ServiceStack.OrmLite.SelectItem[]
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
System.String | tablePrefix |
ShouldSkipInsert(FieldDefinition)
View Source
protected virtual bool ShouldSkipInsert(FieldDefinition fieldDef)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ColumnNameOnly(String)
View Source
public virtual string ColumnNameOnly(string columnExpr)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | columnExpr |
GetInsertFieldDefinitions(ModelDefinition, ICollection<String>)
View Source
public virtual FieldDefinition[] GetInsertFieldDefinitions(ModelDefinition modelDef, ICollection<string> insertFields)
Returns
ServiceStack.OrmLite.FieldDefinition[]
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ICollection<System.String> | insertFields |
ToInsertRowStatement(IDbCommand, Object, ICollection<String>)
View Source
public virtual string ToInsertRowStatement(IDbCommand cmd, object objWithProperties, ICollection<string> insertFields = null)
Returns
System.String
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
System.Object | objWithProperties |
ICollection<System.String> | insertFields |
ToInsertStatement<T>(IDbCommand, T, ICollection<String>)
View Source
public virtual string ToInsertStatement<T>(IDbCommand dbCmd, T item, ICollection<string> insertFields = null)
Returns
System.String
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
<T> | item |
ICollection<System.String> | insertFields |
Type Parameters
T
GetInsertDefaultValue(FieldDefinition)
View Source
protected virtual object GetInsertDefaultValue(FieldDefinition fieldDef)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
PrepareParameterizedInsertStatement<T>(IDbCommand, ICollection<String>, Func<FieldDefinition, Boolean>)
View Source
public virtual void PrepareParameterizedInsertStatement<T>(IDbCommand cmd, ICollection<string> insertFields = null, Func<FieldDefinition, bool> shouldInclude = null)
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
ICollection<System.String> | insertFields |
Func<ServiceStack.OrmLite.FieldDefinition,System.Boolean> | shouldInclude |
Type Parameters
T
PrepareInsertRowStatement<T>(IDbCommand, Dictionary<String, Object>)
View Source
public virtual void PrepareInsertRowStatement<T>(IDbCommand dbCmd, Dictionary<string, object> args)
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
Dictionary<System.String,System.Object> | args |
Type Parameters
T
ToUpdateStatement<T>(IDbCommand, T, ICollection<String>)
View Source
public virtual string ToUpdateStatement<T>(IDbCommand dbCmd, T item, ICollection<string> updateFields = null)
Returns
System.String
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
<T> | item |
ICollection<System.String> | updateFields |
Type Parameters
T
MergeParamsIntoSql(String, IEnumerable<IDbDataParameter>)
View Source
public virtual string MergeParamsIntoSql(string sql, IEnumerable<IDbDataParameter> dbParams)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sql |
IEnumerable<IDbDataParameter> | dbParams |
GetRefSelfSql<From>(SqlExpression<From>, ModelDefinition, FieldDefinition, ModelDefinition)
View Source
public virtual string GetRefSelfSql<From>(SqlExpression<From> refQ, ModelDefinition modelDef, FieldDefinition refSelf, ModelDefinition refModelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.SqlExpression<T> | refQ |
ServiceStack.OrmLite.ModelDefinition | modelDef |
ServiceStack.OrmLite.FieldDefinition | refSelf |
ServiceStack.OrmLite.ModelDefinition | refModelDef |
Type Parameters
From
GetRefFieldSql(String, ModelDefinition, FieldDefinition)
View Source
public virtual string GetRefFieldSql(string subSql, ModelDefinition refModelDef, FieldDefinition refField)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | subSql |
ServiceStack.OrmLite.ModelDefinition | refModelDef |
ServiceStack.OrmLite.FieldDefinition | refField |
GetFieldReferenceSql(String, FieldDefinition, FieldReference)
View Source
public virtual string GetFieldReferenceSql(string subSql, FieldDefinition fieldDef, FieldReference fieldRef)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | subSql |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ServiceStack.OrmLite.FieldReference | fieldRef |
PrepareParameterizedUpdateStatement<T>(IDbCommand, ICollection<String>)
View Source
public virtual bool PrepareParameterizedUpdateStatement<T>(IDbCommand cmd, ICollection<string> updateFields = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
ICollection<System.String> | updateFields |
Type Parameters
T
AppendNullFieldCondition(StringBuilder, FieldDefinition)
View Source
public virtual void AppendNullFieldCondition(StringBuilder sqlFilter, FieldDefinition fieldDef)
Parameters
Type | Name |
---|---|
StringBuilder | sqlFilter |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
AppendFieldCondition(StringBuilder, FieldDefinition, IDbCommand)
View Source
public virtual void AppendFieldCondition(StringBuilder sqlFilter, FieldDefinition fieldDef, IDbCommand cmd)
Parameters
Type | Name |
---|---|
StringBuilder | sqlFilter |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
IDbCommand | cmd |
PrepareParameterizedDeleteStatement<T>(IDbCommand, IDictionary<String, Object>)
View Source
public virtual bool PrepareParameterizedDeleteStatement<T>(IDbCommand cmd, IDictionary<string, object> deleteFieldValues)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
IDictionary<System.String,System.Object> | deleteFieldValues |
Type Parameters
T
PrepareStoredProcedureStatement<T>(IDbCommand, T)
View Source
public virtual void PrepareStoredProcedureStatement<T>(IDbCommand cmd, T obj)
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
<T> | obj |
Type Parameters
T
AddParameter(IDbCommand, FieldDefinition)
Used for adding updated DB params in INSERT and UPDATE statements
View Source
protected IDbDataParameter AddParameter(IDbCommand cmd, FieldDefinition fieldDef)
Returns
IDbDataParameter
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
SetParameter(FieldDefinition, IDbDataParameter)
View Source
public virtual void SetParameter(FieldDefinition fieldDef, IDbDataParameter p)
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
IDbDataParameter | p |
EnableIdentityInsert<T>(IDbCommand)
View Source
public virtual void EnableIdentityInsert<T>(IDbCommand cmd)
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
Type Parameters
T
EnableIdentityInsertAsync<T>(IDbCommand, CancellationToken)
View Source
public virtual Task EnableIdentityInsertAsync<T>(IDbCommand cmd, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
Type Parameters
T
DisableIdentityInsert<T>(IDbCommand)
View Source
public virtual void DisableIdentityInsert<T>(IDbCommand cmd)
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
Type Parameters
T
DisableIdentityInsertAsync<T>(IDbCommand, CancellationToken)
View Source
public virtual Task DisableIdentityInsertAsync<T>(IDbCommand cmd, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
Type Parameters
T
EnableForeignKeysCheck(IDbCommand)
View Source
public virtual void EnableForeignKeysCheck(IDbCommand cmd)
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
EnableForeignKeysCheckAsync(IDbCommand, CancellationToken)
View Source
public virtual Task EnableForeignKeysCheckAsync(IDbCommand cmd, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
DisableForeignKeysCheck(IDbCommand)
View Source
public virtual void DisableForeignKeysCheck(IDbCommand cmd)
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
DisableForeignKeysCheckAsync(IDbCommand, CancellationToken)
View Source
public virtual Task DisableForeignKeysCheckAsync(IDbCommand cmd, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
SetParameterValues<T>(IDbCommand, Object)
View Source
public virtual void SetParameterValues<T>(IDbCommand dbCmd, object obj)
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.Object | obj |
Type Parameters
T
GetFieldDefinitionMap(ModelDefinition)
View Source
public Dictionary<string, FieldDefinition> GetFieldDefinitionMap(ModelDefinition modelDef)
Returns
Dictionary<System.String,ServiceStack.OrmLite.FieldDefinition>
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
SetParameterValue(FieldDefinition, IDataParameter, Object)
View Source
public virtual void SetParameterValue(FieldDefinition fieldDef, IDataParameter p, object obj)
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
IDataParameter | p |
System.Object | obj |
SetParameterSize(FieldDefinition, IDataParameter)
View Source
protected virtual void SetParameterSize(FieldDefinition fieldDef, IDataParameter p)
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
IDataParameter | p |
GetValue(FieldDefinition, Object)
View Source
protected virtual object GetValue(FieldDefinition fieldDef, object obj)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Object | obj |
GetFieldValue(FieldDefinition, Object)
View Source
public object GetFieldValue(FieldDefinition fieldDef, object value)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Object | value |
GetFieldValue(Type, Object)
View Source
public object GetFieldValue(Type fieldType, object value)
Returns
System.Object
Parameters
Type | Name |
---|---|
Type | fieldType |
System.Object | value |
GetValueOrDbNull(FieldDefinition, Object)
View Source
protected virtual object GetValueOrDbNull(FieldDefinition fieldDef, object obj)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Object | obj |
GetQuotedValueOrDbNull<T>(FieldDefinition, Object)
View Source
protected virtual object GetQuotedValueOrDbNull<T>(FieldDefinition fieldDef, object obj)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.Object | obj |
Type Parameters
T
PrepareUpdateRowStatement(IDbCommand, Object, ICollection<String>)
View Source
public virtual void PrepareUpdateRowStatement(IDbCommand dbCmd, object objWithProperties, ICollection<string> updateFields = null)
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.Object | objWithProperties |
ICollection<System.String> | updateFields |
PrepareUpdateRowStatement<T>(IDbCommand, Dictionary<String, Object>, String)
View Source
public virtual void PrepareUpdateRowStatement<T>(IDbCommand dbCmd, Dictionary<string, object> args, string sqlFilter)
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
Dictionary<System.String,System.Object> | args |
System.String | sqlFilter |
Type Parameters
T
PrepareUpdateRowAddStatement<T>(IDbCommand, Dictionary<String, Object>, String)
View Source
public virtual void PrepareUpdateRowAddStatement<T>(IDbCommand dbCmd, Dictionary<string, object> args, string sqlFilter)
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
Dictionary<System.String,System.Object> | args |
System.String | sqlFilter |
Type Parameters
T
ToDeleteStatement(Type, String, Object[])
View Source
public virtual string ToDeleteStatement(Type tableType, string sqlFilter, params object[] filterParams)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | tableType |
System.String | sqlFilter |
System.Object[] | filterParams |
HasInsertReturnValues(ModelDefinition)
View Source
public virtual bool HasInsertReturnValues(ModelDefinition modelDef)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetDefaultValue(Type, String)
View Source
public string GetDefaultValue(Type tableType, string fieldName)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | tableType |
System.String | fieldName |
GetDefaultValue(FieldDefinition)
View Source
public virtual string GetDefaultValue(FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ResolveFragment(String)
View Source
public virtual string ResolveFragment(string sql)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sql |
GetAutoIdDefaultValue(FieldDefinition)
View Source
public virtual string GetAutoIdDefaultValue(FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.FieldDefinition | fieldDef |
GetFieldDefinitions(ModelDefinition)
View Source
public static IEnumerable<FieldDefinition> GetFieldDefinitions(ModelDefinition modelDef)
Returns
IEnumerable<ServiceStack.OrmLite.FieldDefinition>
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ToCreateSchemaStatement(String)
View Source
public abstract string ToCreateSchemaStatement(string schemaName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schemaName |
GetSchemas(IDbCommand)
View Source
public virtual List<string> GetSchemas(IDbCommand dbCmd)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
GetSchemaTables(IDbCommand)
View Source
public virtual Dictionary<string, List<string>> GetSchemaTables(IDbCommand dbCmd)
Returns
Dictionary<System.String,List<System.String>>
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
DoesSchemaExist(IDbCommand, String)
View Source
public abstract bool DoesSchemaExist(IDbCommand dbCmd, string schemaName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.String | schemaName |
DoesSchemaExistAsync(IDbCommand, String, CancellationToken)
View Source
public virtual Task<bool> DoesSchemaExistAsync(IDbCommand dbCmd, string schema, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.String | schema |
CancellationToken | token |
ToCreateTableStatement(Type)
View Source
public virtual string ToCreateTableStatement(Type tableType)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | tableType |
GetUniqueConstraints(ModelDefinition)
View Source
public virtual string GetUniqueConstraints(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetUniqueConstraintName(UniqueConstraintAttribute, String)
View Source
protected virtual string GetUniqueConstraintName(UniqueConstraintAttribute constraint, string tableName)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.DataAnnotations.UniqueConstraintAttribute | constraint |
System.String | tableName |
GetCheckConstraint(ModelDefinition, FieldDefinition)
View Source
public virtual string GetCheckConstraint(ModelDefinition modelDef, FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ToPostCreateTableStatement(ModelDefinition)
View Source
public virtual string ToPostCreateTableStatement(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ToPostDropTableStatement(ModelDefinition)
View Source
public virtual string ToPostDropTableStatement(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetForeignKeyOnDeleteClause(ForeignKeyConstraint)
View Source
public virtual string GetForeignKeyOnDeleteClause(ForeignKeyConstraint foreignKey)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ForeignKeyConstraint | foreignKey |
GetForeignKeyOnUpdateClause(ForeignKeyConstraint)
View Source
public virtual string GetForeignKeyOnUpdateClause(ForeignKeyConstraint foreignKey)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ForeignKeyConstraint | foreignKey |
ToCreateIndexStatements(Type)
View Source
public virtual List<string> ToCreateIndexStatements(Type tableType)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
Type | tableType |
DoesTableExist(IDbConnection, String, String)
View Source
public virtual bool DoesTableExist(IDbConnection db, string tableName, string schema = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | tableName |
System.String | schema |
DoesTableExistAsync(IDbConnection, String, String, CancellationToken)
View Source
public virtual async Task<bool> DoesTableExistAsync(IDbConnection db, string tableName, string schema = null, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | tableName |
System.String | schema |
CancellationToken | token |
DoesTableExist(IDbCommand, String, String)
View Source
public virtual bool DoesTableExist(IDbCommand dbCmd, string tableName, string schema = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.String | tableName |
System.String | schema |
DoesTableExistAsync(IDbCommand, String, String, CancellationToken)
View Source
public virtual Task<bool> DoesTableExistAsync(IDbCommand dbCmd, string tableName, string schema = null, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.String | tableName |
System.String | schema |
CancellationToken | token |
DoesColumnExist(IDbConnection, String, String, String)
View Source
public virtual bool DoesColumnExist(IDbConnection db, string columnName, string tableName, string schema = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | columnName |
System.String | tableName |
System.String | schema |
DoesColumnExistAsync(IDbConnection, String, String, String, CancellationToken)
View Source
public virtual Task<bool> DoesColumnExistAsync(IDbConnection db, string columnName, string tableName, string schema = null, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | columnName |
System.String | tableName |
System.String | schema |
CancellationToken | token |
DoesSequenceExist(IDbCommand, String)
View Source
public virtual bool DoesSequenceExist(IDbCommand dbCmd, string sequence)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.String | sequence |
DoesSequenceExistAsync(IDbCommand, String, CancellationToken)
View Source
public virtual Task<bool> DoesSequenceExistAsync(IDbCommand dbCmd, string sequenceName, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
System.String | sequenceName |
CancellationToken | token |
GetIndexName(Boolean, String, String)
View Source
protected virtual string GetIndexName(bool isUnique, string modelName, string fieldName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Boolean | isUnique |
System.String | modelName |
System.String | fieldName |
GetCompositeIndexName(CompositeIndexAttribute, ModelDefinition)
View Source
protected virtual string GetCompositeIndexName(CompositeIndexAttribute compositeIndex, ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.DataAnnotations.CompositeIndexAttribute | compositeIndex |
ServiceStack.OrmLite.ModelDefinition | modelDef |
GetCompositeIndexNameWithSchema(CompositeIndexAttribute, ModelDefinition)
View Source
protected virtual string GetCompositeIndexNameWithSchema(CompositeIndexAttribute compositeIndex, ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.DataAnnotations.CompositeIndexAttribute | compositeIndex |
ServiceStack.OrmLite.ModelDefinition | modelDef |
ToCreateIndexStatement(Boolean, String, ModelDefinition, String, Boolean, FieldDefinition)
View Source
protected virtual string ToCreateIndexStatement(bool isUnique, string indexName, ModelDefinition modelDef, string fieldName, bool isCombined = false, FieldDefinition fieldDef = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Boolean | isUnique |
System.String | indexName |
ServiceStack.OrmLite.ModelDefinition | modelDef |
System.String | fieldName |
System.Boolean | isCombined |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ToCreateSequenceStatements(Type)
View Source
public virtual List<string> ToCreateSequenceStatements(Type tableType)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
Type | tableType |
ToCreateSequenceStatement(Type, String)
View Source
public virtual string ToCreateSequenceStatement(Type tableType, string sequenceName)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | tableType |
System.String | sequenceName |
SequenceList(Type)
View Source
public virtual List<string> SequenceList(Type tableType)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
Type | tableType |
SequenceListAsync(Type, CancellationToken)
View Source
public virtual Task<List<string>> SequenceListAsync(Type tableType, CancellationToken token = null)
Returns
Task<List<System.String>>
Parameters
Type | Name |
---|---|
Type | tableType |
CancellationToken | token |
ToExistStatement(Type, Object, String, Object[])
View Source
public virtual string ToExistStatement(Type fromTableType, object objWithProperties, string sqlFilter, params object[] filterParams)
Returns
System.String
Parameters
Type | Name |
---|---|
Type | fromTableType |
System.Object | objWithProperties |
System.String | sqlFilter |
System.Object[] | filterParams |
ToSelectFromProcedureStatement(Object, Type, String, Object[])
View Source
public virtual string ToSelectFromProcedureStatement(object fromObjWithProperties, Type outputModelType, string sqlFilter, params object[] filterParams)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | fromObjWithProperties |
Type | outputModelType |
System.String | sqlFilter |
System.Object[] | filterParams |
ToExecuteProcedureStatement(Object)
View Source
public virtual string ToExecuteProcedureStatement(object objWithProperties)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | objWithProperties |
GetModel(Type)
View Source
protected static ModelDefinition GetModel(Type modelType)
Returns
ServiceStack.OrmLite.ModelDefinition
Parameters
Type | Name |
---|---|
Type | modelType |
SqlExpression<T>()
View Source
public virtual SqlExpression<T> SqlExpression<T>()
Returns
ServiceStack.OrmLite.SqlExpression<T>
Type Parameters
T
CreateParameterizedDeleteStatement(IDbConnection, Object)
View Source
public IDbCommand CreateParameterizedDeleteStatement(IDbConnection connection, object objWithProperties)
Returns
IDbCommand
Parameters
Type | Name |
---|---|
IDbConnection | connection |
System.Object | objWithProperties |
GetDropForeignKeyConstraints(ModelDefinition)
View Source
public virtual string GetDropForeignKeyConstraints(ModelDefinition modelDef)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.ModelDefinition | modelDef |
ToAddColumnStatement(String, String, FieldDefinition)
View Source
public virtual string ToAddColumnStatement(string schema, string table, FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ToAlterColumnStatement(String, String, FieldDefinition)
View Source
public virtual string ToAlterColumnStatement(string schema, string table, FieldDefinition fieldDef)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
ToChangeColumnNameStatement(String, String, FieldDefinition, String)
View Source
public virtual string ToChangeColumnNameStatement(string schema, string table, FieldDefinition fieldDef, string oldColumn)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
ServiceStack.OrmLite.FieldDefinition | fieldDef |
System.String | oldColumn |
ToRenameColumnStatement(String, String, String, String)
View Source
public virtual string ToRenameColumnStatement(string schema, string table, string oldColumn, string newColumn)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
System.String | oldColumn |
System.String | newColumn |
ToAddForeignKeyStatement<T, TForeign>(Expression<Func<T, Object>>, Expression<Func<TForeign, Object>>, OnFkOption, OnFkOption, String)
View Source
public virtual string ToAddForeignKeyStatement<T, TForeign>(Expression<Func<T, object>> field, Expression<Func<TForeign, object>> foreignField, OnFkOption onUpdate, OnFkOption onDelete, string foreignKeyName = null)
Returns
System.String
Parameters
Type | Name |
---|---|
Expression<Func<<T>,System.Object>> | field |
Expression<Func<<TForeign>,System.Object>> | foreignField |
ServiceStack.OrmLite.OnFkOption | onUpdate |
ServiceStack.OrmLite.OnFkOption | onDelete |
System.String | foreignKeyName |
Type Parameters
T
TForeign
ToCreateIndexStatement<T>(Expression<Func<T, Object>>, String, Boolean)
View Source
public virtual string ToCreateIndexStatement<T>(Expression<Func<T, object>> field, string indexName = null, bool unique = false)
Returns
System.String
Parameters
Type | Name |
---|---|
Expression<Func<<T>,System.Object>> | field |
System.String | indexName |
System.Boolean | unique |
Type Parameters
T
FkOptionToString(OnFkOption)
View Source
protected virtual string FkOptionToString(OnFkOption option)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.OnFkOption | option |
GetQuotedValue(Object, Type)
View Source
public virtual string GetQuotedValue(object value, Type fieldType)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
Type | fieldType |
GetParamValue(Object, Type)
View Source
public virtual object GetParamValue(object value, Type fieldType)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | value |
Type | fieldType |
InitQueryParam(IDbDataParameter)
View Source
public virtual void InitQueryParam(IDbDataParameter param)
Parameters
Type | Name |
---|---|
IDbDataParameter | param |
InitUpdateParam(IDbDataParameter)
View Source
public virtual void InitUpdateParam(IDbDataParameter param)
Parameters
Type | Name |
---|---|
IDbDataParameter | param |
EscapeWildcards(String)
View Source
public virtual string EscapeWildcards(string value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | value |
GetLoadChildrenSubSelect<From>(SqlExpression<From>)
View Source
public virtual string GetLoadChildrenSubSelect<From>(SqlExpression<From> expr)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.OrmLite.SqlExpression<T> | expr |
Type Parameters
From
ToRowCountStatement(String)
View Source
public virtual string ToRowCountStatement(string innerSql)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | innerSql |
ToDropColumnStatement(String, String, String)
View Source
public virtual string ToDropColumnStatement(string schema, string table, string column)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
System.String | table |
System.String | column |
ToTableNamesStatement(String)
View Source
public virtual string ToTableNamesStatement(string schema)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | schema |
ToTableNamesWithRowCountsStatement(Boolean, String)
View Source
public virtual string ToTableNamesWithRowCountsStatement(bool live, string schema)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Boolean | live |
System.String | schema |
SqlConflict(String, String)
View Source
public virtual string SqlConflict(string sql, string conflictResolution)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sql |
System.String | conflictResolution |
SqlConcat(IEnumerable<Object>)
View Source
public virtual string SqlConcat(IEnumerable<object> args)
Returns
System.String
Parameters
Type | Name |
---|---|
IEnumerable<System.Object> | args |
SqlCurrency(String)
View Source
public virtual string SqlCurrency(string fieldOrValue)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | fieldOrValue |
SqlCurrency(String, String)
View Source
public virtual string SqlCurrency(string fieldOrValue, string currencySymbol)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | fieldOrValue |
System.String | currencySymbol |
SqlBool(Boolean)
View Source
public virtual string SqlBool(bool value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Boolean | value |
SqlLimit(Nullable<Int32>, Nullable<Int32>)
View Source
public virtual string SqlLimit(int? offset = null, int? rows = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Nullable<System.Int32> | offset |
System.Nullable<System.Int32> | rows |
SqlCast(Object, String)
View Source
public virtual string SqlCast(object fieldOrValue, string castAs)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | fieldOrValue |
System.String | castAs |
OpenAsync(IDbConnection, CancellationToken)
View Source
public virtual Task OpenAsync(IDbConnection db, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IDbConnection | db |
CancellationToken | token |
ExecuteReaderAsync(IDbCommand, CancellationToken)
View Source
public virtual Task<IDataReader> ExecuteReaderAsync(IDbCommand cmd, CancellationToken token = null)
Returns
Task<IDataReader>
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
ExecuteNonQueryAsync(IDbCommand, CancellationToken)
View Source
public virtual Task<int> ExecuteNonQueryAsync(IDbCommand cmd, CancellationToken token = null)
Returns
Task<System.Int32>
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
ExecuteScalarAsync(IDbCommand, CancellationToken)
View Source
public virtual Task<object> ExecuteScalarAsync(IDbCommand cmd, CancellationToken token = null)
Returns
Task<System.Object>
Parameters
Type | Name |
---|---|
IDbCommand | cmd |
CancellationToken | token |
ReadAsync(IDataReader, CancellationToken)
View Source
public virtual Task<bool> ReadAsync(IDataReader reader, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
IDataReader | reader |
CancellationToken | token |
ReaderEach<T>(IDataReader, Func<T>, CancellationToken)
View Source
public virtual async Task<List<T>> ReaderEach<T>(IDataReader reader, Func<T> fn, CancellationToken token = null)
Returns
Task<List<<T>>>
Parameters
Type | Name |
---|---|
IDataReader | reader |
Func<<T>> | fn |
CancellationToken | token |
Type Parameters
T
ReaderEach<Return>(IDataReader, Action, Return, CancellationToken)
View Source
public virtual async Task<Return> ReaderEach<Return>(IDataReader reader, Action fn, Return source, CancellationToken token = null)
Returns
Task<<Return>>
Parameters
Type | Name |
---|---|
IDataReader | reader |
Action | fn |
<Return> | source |
CancellationToken | token |
Type Parameters
Return
ReaderRead<T>(IDataReader, Func<T>, CancellationToken)
View Source
public virtual async Task<T> ReaderRead<T>(IDataReader reader, Func<T> fn, CancellationToken token = null)
Returns
Task<<T>>
Parameters
Type | Name |
---|---|
IDataReader | reader |
Func<<T>> | fn |
CancellationToken | token |
Type Parameters
T
InsertAndGetLastInsertIdAsync<T>(IDbCommand, CancellationToken)
View Source
public virtual Task<long> InsertAndGetLastInsertIdAsync<T>(IDbCommand dbCmd, CancellationToken token)
Returns
Task<System.Int64>
Parameters
Type | Name |
---|---|
IDbCommand | dbCmd |
CancellationToken | token |
Type Parameters
T